#ifndef CONTROLLER_H
#define CONTROLLER_H

#include <QObject>
#include <QThread>
#include <QTimer>

class Controller : public QObject {
  Q_OBJECT
public:
  explicit Controller(QObject *parent = nullptr);
  ~Controller() override;

  QThread m_workerThread;
  QThread m_timeThread;
  QTimer m_timer;
  void initTimer();
public slots:
  static void handleResults(int result); // 处理子线程执行的结果

  void timeout();
signals:
  void operate(const int); // 发送信号，触发线程
};

#endif // CONTROLLER_H
